package com.android.support.lib.universal.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.widget.BaseAdapter;

/**
 * 继承MyBaseAdapter，实现其抽象方法getView()和重写构造方法即可。
 *
 * @author 彭治铭
 */
public abstract class MyBaseAdapter extends BaseAdapter {
    protected LayoutInflater mInflater;
    protected List<?> list;// 泛形

    public MyBaseAdapter(Context context, List<?> list) {
        this.mInflater = LayoutInflater.from(context);
        this.list = list;
    }

    @Override
    public int getCount() {// 返回列表的个数
        // TODO Auto-generated method stub
        return list.size();
    }

    @Override
    public Object getItem(int arg0) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public long getItemId(int arg0) {
        // TODO Auto-generated method stub
        return 0;
    }

    // @Override
    // public View getView(int position, View convertView, ViewGroup parent) {
    //
    //convertView = mInflater.inflate(R.layout.vlist2, null);
    // ImageView img_grid= (ImageView) convertView.findViewById(R.id.img_grid);
    // return convertView;
    // }

}
